# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=age
pkgver=1.0.0
pkgrel=5
pkgdesc="Simple, modern and secure encryption tool"
url="https://github.com/FiloSottile/age"
license="BSD-3-Clause"
arch="all"
options="net" # for downloading Go modules
makedepends="go"
subpackages="$pkgname-doc"
source="https://github.com/FiloSottile/age/archive/v$pkgver/age-$pkgver.tar.gz"

export GOPATH="$srcdir"
export GOFLAGS="$GOFLAGS -trimpath -modcacherw"
export CGO_ENABLED=0

build() {
	mkdir bin
	go build -ldflags "-X main.Version=$pkgver" -o bin ./cmd/...
}

check() {
	go test ./...
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin bin/*
	install -Dm644 -t "$pkgdir"/usr/share/man/man1 doc/*.1
}

sha512sums="
77ea1af03a76339f4e934222bc9fc6119698080d0e03011c79b25119e0e8a1e6c0772ede5069cd63bde48cfaa4d355c897912741680e8b0c52d4c518182c2f7f  age-1.0.0.tar.gz
"
